package pl.streamsoft.test.currency_view;

import java.awt.Component;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

public class ApplicationView extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2780284943555866960L;

	protected Component getComponent() {
		return this;
	}

	public void showMessage(String title, String message) {
		JOptionPane.showMessageDialog(this.getComponent(), message, title,
				JOptionPane.INFORMATION_MESSAGE);
	}

	public void showWarning(String title, String message) {
		JOptionPane.showMessageDialog(this.getComponent(), message, title,
				JOptionPane.WARNING_MESSAGE);
	}

	public void showError(String title, String message) {
		JOptionPane.showMessageDialog(this.getComponent(), message, title,
				JOptionPane.ERROR_MESSAGE);
	}

	public boolean confirmDialog(String title, String message) {
		return JOptionPane.showConfirmDialog(this.getComponent(), message,
				title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
	}

}
